package com.example.dbscrew.util;

public class ProgressUtil {

    public static void showProgress(int current, int total) {
        double progress = (double) current / total * 100;
        int barLength = 50; // 进度条长度
        int filledLength = barLength * current / total;

        char[] barChars = new char[barLength];
        for (int i = 0; i < barLength; i++) {
            barChars[i] = (i < filledLength) ? '=' : ' ';
        }
        String bar = new String(barChars);

        System.out.printf("完成进度: [%s] %.2f%%\n", bar, progress);
    }

}
